package lab02.test34;

import java.util.*;

/**
 * Created by 婷婷 on 2017/11/22.
 */
public class Test34 {
    public static void main(String[] args) {

        List <String> list = new ArrayList<String>();
        list.add("apple");
        list.add("grape");
        list.add("banana");
        list.add("pear ");

        String max = Collections.max(list);
        String min = Collections.min(list);

        System.out.println("集合中最大的元素是："+max);
        System.out.println("集合中最小的元素是："+min);

        for (String n:list){
            System.out.println("排序后的结果："+n);
        }

    }
}
